package com.queseraly.myweb.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.queseraly.myweb.component.ListConverter;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import java.util.List;

/**
 * @author laiyong
 * @version v1.0
 * @since 2024/1/1
 */
@Getter
@Setter
@ToString
@EqualsAndHashCode
public class Data {
    @ExcelIgnore
    private int id;

    @NotBlank(message = "姓名不能为空")
    @ExcelProperty(value = "姓名")
    private String name;

    @Range(min = 1, max = 100, message = "年龄超过范围[0-100]")
    @ExcelProperty(value = "年龄")
    private int age;

    @NotBlank(message = "性别不能为空")
    @ExcelProperty(value = "性别")
    private String gender;

    @NotEmpty
    @ExcelProperty(value = "爱好", converter = ListConverter.class)
    private List<String> hobbyList;
}
